import React, { useState } from 'react';
import { axconst } from '@/shared/axconst';
import Search from './components/search';
import AxColumnAction from '@/components/AxList/AxColumnAction';
import { AxStandardCardButtonType, AxStandardCardFilterType } from '@/components/AxList/AxStandardLayout/data.d';
import { AxStandardWideList } from '@/components/AxList/AxStandardWideList';

const Index: React.FC<any> = props => {
    /** 配置列 */
    const columns = [
        {
            title: '消息内容',
            dataIndex: 'orgName1',
            width: axconst.width.longx,
        },
        {
            title: '消息类型',
            dataIndex: 'orgName2',
            width: axconst.width.four,
        },
        {
            title: '时间',
            dataIndex: 'orgName3',
            width: axconst.width.time,
        },
        {
            title: '操作',
            dataIndex: 'orgName4',
            width: axconst.width.operate8,
            render: (val: any, record: any) => (
                <AxColumnAction
                    buttons={[
                        {
                            text: '查看',
                            group: false,
                            onClick: () => { },
                        },
                    ]}
                />
            ),
        },
    ];

    const data = {
        list: [{
            id: 0,
            orgName1: '消息内容消息内容消息内容消息内容消息内容消息内容',
            orgName2: '消息类型1',
            orgName3: '2020-01-02 11:00:00',
        }, {
            id: 1,
            orgName1: '消息内容消息内容消息内容消息内容消息内容消息内容',
            orgName2: '消息类型2',
            orgName3: '2020-01-03 11:00:00',
        }]
    }

    /** 配置操作按钮 */
    const button: AxStandardCardButtonType[] = [];

    /** 配置筛选器 */
    const filter: AxStandardCardFilterType[] = []

    return (
        <>
            <AxStandardWideList
                columns={columns}
                button={button}
                filter={filter}
                data={data}
                AdvancedSearch={Search}
            />
        </>
    );
};

export default Index;
